
<%@ page import="givenchy.Invite" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'invite.label', default: 'Invite')}" />
        <title><g:message code="default.list.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="tasknav">
            <span class="menuButton"><g:link class="create" action="create">生成CODE</g:link></span>
        </div>
        <div class="body">
            <h1>邀请码列表</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                        
           
                            <g:sortableColumn property="code" title="代码" />
                        
                            <g:sortableColumn property="isUsed" title="是否被使用" />
                        
                            <g:sortableColumn property="person" title="使用人ID" />

                            <th>生成时间</th>
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${inviteInstanceList}" status="i" var="inviteInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                        
                            <td>${fieldValue(bean: inviteInstance, field: "code")}</td>
                        
                            <td><g:formatBoolean boolean="${inviteInstance.isUsed}"  true="已用" false="未用"/></td>
                        
                            <td>${fieldValue(bean: inviteInstance, field: "person")}</td>

                            <td><g:formatDate format="yyyy-MM-dd" date="${inviteInstance.createTime}"/></td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${inviteInstanceTotal}" />
            </div>
        </div>
    </body>
</html>
